Gpu self throttling

ABSTRACT

Techniques for GPU self throttling are described. In one or more embodiments, timing information for GPU frame processing is obtained using a timeline for the GPU. This may occur by inserting callbacks into the GPU processing timeline. An elapsed time for unpredictable work that is inserted into the GPU workload is determined based on the obtained timing information. A decision is then made regarding whether to “throttle” designated optional/non-critical portions of the work for a frame based on the amount of elapsed time. In one approach the elapsed time is compared to a configurable timing threshold. If the elapsed time exceeds the threshold, work is throttled by performing light or no processing for one or more optional portions of a frame. If the elapsed time is less than the threshold, heavy processing (e.g., “normal” work) is performed for the frame.

RELATED APPLICATIONS

This application claims the benefit under 35 U.S.C. §119(e) of a relatedU.S. Provisional Application Ser. No. 61/542,213 filed Oct. 2, 2011titled “GPU Self Throttling” to Sagall et al., the disclosure of whichis incorporated by reference herein in its entirety.

BACKGROUND

When rendering graphics/frames for a real-time application, such as avideo game, it is often hard to predict how long a particular part ofthe frame will take. If it is determined ahead of time that a frame isgoing to take a relatively long time to render (e.g., based on sometiming threshold), steps may be taken to lower the burden on the GPU(graphics processing unit) by not rendering some non-critical parts ofthe frame. One traditional solution relies upon the CPU (centralprocessing unit) timeline to time the rendering and take correctiveaction based on the timing. However, using the CPU timeline may beproblematic because by the time that the CPU knows a timing issueexists, the work for the next frame may have already been submitted tothe GPU and it may be very difficult or impossible to fix a precedingframe. Generally, traditional systems address this by always assuming aworst case scenario for frame processing, which results inunder-utilization of the GPU much of the time.

SUMMARY

This Summary is provided to introduce a selection of concepts in asimplified form that are further described below in the DetailedDescription. This Summary is not intended to identify key features oressential features of the claimed subject matter, nor is it intended tobe used to limit the scope of the claimed subject matter.

Techniques for GPU self throttling are described. In one or moreembodiments, timing information for GPU frame processing is obtainedusing a timeline for the GPU. This may occur by inserting callbacks intothe GPU processing timeline. An elapsed time for unpredictable work thatis inserted into the GPU workload is determined based on the obtainedtiming information. A decision is then made regarding whether to“throttle” designated optional/non-critical portions of the work for aframe based on the amount of elapsed time. In one approach the elapsedtime is compared to a configurable timing threshold. If the elapsed timeexceeds the threshold, work is throttled by performing light or noprocessing for one or more optional portions of a frame. If the elapsedtime is less than the threshold, heavy processing (e.g., “normal” work)is performed for the frame.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 illustrates an example operating environment in which one or moreembodiments of GPU self throttling can be employed.

FIG. 2 is an example timeline diagram for GPU self throttling inaccordance with one or more embodiments.

FIG. 3 is a flow diagram that describes details of an example procedurefor GPU self throttling in accordance with one or more embodiments.

FIG. 4 is a block diagram of a system that can implement the variousembodiments.

DETAILED DESCRIPTION

Overview

Techniques for GPU self throttling are described. In one or moreembodiments, timing information for GPU frame processing is obtainedusing a timeline for the GPU. This may occur by inserting callbacks intothe GPU processing timeline. An elapsed time for unpredictable work thatis inserted into the GPU workload is determined based on the obtainedtiming information. A decision is then made regarding whether to“throttle” designated optional/non-critical portions of the work for aframe based on the amount of elapsed time. In one approach the elapsedtime is compared to a configurable timing threshold. If the elapsed timeexceeds the threshold, work is throttled by performing light or noprocessing for one or more optional portions of a frame. If the elapsedtime is less than the threshold, heavy processing (e.g., “normal” work)is performed for the frame.

In the discussion that follows, a section titled “Operating Environment”is provided and describes one environment in which one or moreembodiments can be employed. Following this, a section titled “GPU SelfThrottling Techniques” describes example techniques in accordance withone or more embodiments. Last, a section titled “Example System”describes example computing systems and devices that can be utilized toimplement one or more embodiments.

Operating Environment

FIG. 1 illustrates an operating environment in accordance with one ormore embodiments, generally at 100. The environment 100 includes acomputing device 102 having one or more processors 104 (e.g., CPUs), oneor more computer-readable media 106, an operating system 108, and one ormore applications 110 that reside on the computer-readable media andwhich are executable by the processor(s). The one or more processors 104may retrieve and execute computer-program instructions from applications110 to provide a wide range of functionality to the computing device102, including but not limited to gaming, office productivity, email,media management, printing, networking, web-browsing, and so forth. Avariety of data and program files related to the applications 110 canalso be included, examples of which include games files, officedocuments, multimedia files, emails, data files, web pages, user profileand/or preference data, and so forth.

The computing device 102 can be embodied as any suitable computingsystem and/or device such as, by way of example and not limitation, agaming system, a desktop computer, a portable computer, a tablet orslate computer, a handheld computer such as a personal digital assistant(PDA), a cell phone, a set-top box, and the like. For example, as shownin FIG. 1 the computing device 102 can be implemented as a televisionclient device 112, a computer 114, and/or a gaming system 116 that isconnected to a display device 118 to display media content.Alternatively, the computing device may be any type of portablecomputer, mobile phone, or portable device 120 that includes anintegrated display 122. Any of the computing devices can be implementedwith various components, such as one or more processors and memorydevices, as well as with any combination of differing components. Oneexample of a computing system that can represent various systems and/ordevices including the computing device 102 is shown and described belowin FIG. 4.

The computer-readable media can include, by way of example and notlimitation, all forms of volatile and non-volatile memory and/or storagemedia that are typically associated with a computing device. Such mediacan include ROM, RAM, flash memory, hard disk, removable media and thelike. Computer-readable media can include both “computer-readablestorage media” and “communication media,” examples of which can be foundin the discussion of the example computing system of FIG. 4.

The computing device 102 also includes a graphics processing unit (GPU)124 separate from the processor(s) 104 that operates to perform variousprocessing related to graphics output by the computing device fordisplay on the display device 118 or integrated display 124. The GPU 124is a hardware component of the computing device that is dedicated tographics processing. Functionality provided by the GPU 124 may includecontrolling aspects of resolution, pixel shading operations, colordepth, texture mapping, 3D rendering, and other tasks associated withrendering user interfaces and images for applications. This can includeprocessing tasks such as polygon drawing, bitmap transfers and painting,window resizing and repositioning, line drawing, font scaling, and soforth. The GPU 124 may be capable of handling these processing tasks inhardware at greater speeds than software that is executed on theprocessor(s) 104. Thus, the dedicated graphics processing capability ofthe GPU 124 can accelerate graphics processing, reduce the workload ofthe processor(s) 104, and free up system resources for other tasks. TheGPU 124 and processor(s) 104 (e.g., CPUs) may perform separatesequential processing of commands on different respective timelines forrendering of frames, graphics, and/or other processing tasks.

The computing device 102 also includes a throttling module 126 thatresides on the computer-readable media and which is executable by theprocessor(s). The throttling module 126 represents functionality toperform various techniques for GPU self throttling described above andbelow. The throttling module 126 may be implemented as a component of anapplication 110 used to control aspects of graphics processing. Forinstance, the throttling module 126 may be provided as part of a gameapplication for a gaming system to facilitate rendering of frames forthe game via the GPU 124 in accordance with techniques described herein.The throttling module 126 may also be implemented as a standalonecomponent as depicted in FIG. 1. In at least some embodiments, thethrottling module 126 and a corresponding application 110 may beexecuted using different respective processes.

In some instances, unpredictable system processing or otherunpredictable work may arise in the course of rendering frames. Suchunpredictable work may interfere with GPU processing and increase theburden on the GPU. In such instances, the burden on the GPU may bereduced by skipping some of the work that is considered optional ornon-critical to a frame. Because the work that creates these instancesis unpredictable, timing information for frame processing is employed todetermine how long frame processing is taking When frame processingtakes longer than expected and/or exceeds a designated timing threshold,this indicates that some unpredictable work has occurred and correctiveaction(s) may be taken to reduce the burden on the GPU, balance theworkload, and avoid frame rate drops.

In one or more embodiments, the GPU 124 may be operated under theinfluence of the throttling module 126 to control the work performed bythe GPU 124. In general, GPU self throttling involves gathering timinginformation from any suitable source and using the timing informationfor frames to determine whether or not to throttle processing for theframes performed by the GPU 124. In accordance with techniques describedherein, the timing information is obtained from the GPU timeline ratherthan the CPU timeline. The timelines herein refer to the sequences ofcommands being executed separately by the GPU and CPU. Because, the CPUtimeline may run ahead of the GPU for frame processing, the CPU may notbe in a position to make decisions for processing occurring for a priorframe on the GPU. The GPU self throttling approach ensures thatsufficient time is available to take corrective actions based on thetiming information to fix-up the frames when appropriate. In otherwords, a decision regarding whether to drop or “throttle” some of theGPU work can be made “just-in time” so that an on-demand choice toconduct heavy or light processing may be made as late as possible in thetimeline of the GPU.

In one particular approach, built-in timing registers associated withthe GPU 124 are used to gather the timing information. One way this mayoccur is by setting callbacks that run on the CPU when a certain,variable portion of the GPU frame is hit. Although the callbacks are setto execute on the CPU, the timing for the callbacks is controlled by theGPU timeline. The callbacks may be implemented to obtain values for thecurrent time at different points in the GPU timeline that can be used tocompute an elapsed time for the unpredictable/system work. In oneapproach, the callbacks may be inserted or otherwise included ascommands in the sequence of commands executed by the GPU 124.

For instance, the throttling module 126 may be configured to insertcallbacks both before and after the variable parts of frames. Thevariable parts of the frames refer to parts of the frames that mayinclude system work and/or other work that can occur at unpredictabletimes and vary in amount of time/processing to perform the work.Effectively, the timing information gathered through the callbacks (orotherwise) is used to make a determination regarding whether to performfull/heavy processing or throttle the work to perform partial/lightprocessing. When throttling is triggered based on an elapsed time forunpredictable work, the workload on the GPU may be reduced by skippingportions of a frame designated as optional/non-critical because theseparts may be skipped without substantially degrading the quality and/orappearance of the frame. This approach may be used to identify andmeasure timing for unpredictable work that may adversely affect the GPUtimeline. Then, corrective action(s) may be taken to skip optional workso that the frame rendering timeline/frame rate can be maintained.

Various different portions and/or types of processing for a frame may beselected and designated as optional/non-critical by an applicationdeveloper. Portions and/or processing that are designated asoptional/non-critical may be selectively skipped in accordance with GPUself throttling techniques described above and below. By way of example,portions and/or processing that may be designated as optional includebut are not limited to, select batched commands in an asynchronouscommand buffer, background and other non-critical elements, and/ordesignated special effects such as bloom rendering, shadows, andshading.

When the callback is executed, the CPU is interrupted, briefly, and thecallback code is effectively run as part of the GPU timeline. During thefirst callback, timing registers are read and values of the registersare recorded. During the second callback, the registers are read againand a determination may be made regarding whether or not the frame isrunning long. Parts of the frame may be fixed-up depending on theresults. For instance, the optional parts of the frame can be modifiedby “fixing up” nested command buffer calls that the GPU will consumelater in the frame. When the frame is running long, some command buffercommands/calls may be set to null to skip over the work. In anotherapproach, different command buffers for the same frame work may beprovided that involve different amounts of processing (e.g., differentworkloads). Thus, one command buffer may be associated with heavyprocessing for use in “normal” conditions and another command buffer maybe associated with light or no processing for use in “throttling”conditions. In this case, the throttling module 126 may be configured toselect an appropriate one of the command buffers for GPU processingbased upon timing information that is gathered in the manner previouslydescribed.

Having described an example operating environment, consider now exampletechniques for GPU Self Throttling in accordance with one or moreembodiments.

GPU Self Throttling Techniques

FIG. 2 depicts an example timeline diagram 200 in accordance with one ormore embodiments. The diagram shows a GPU 202 timeline and a CPUtimeline 204. As illustrated, various callbacks are included in the GPUtimeline 202 for different frames. Hatched portions 206 representunpredictable work (e.g., system work) for which timing information isto be obtained. The shaded portions 208 represent work of the GPU thatcan be throttled (e.g., optional/non-critical work).

For each frame, a first callback 210 is inserted at the end of apreceding frame or otherwise before variable parts of a particularframe. A second callback 212 is inserted after the variable parts of theparticular frame, which in some cases may correspond to the start of“normal” processing for the particular frame. The first callback callsinto the CPU, gets the current timestamp at the end of one frame and/orbefore the variable frame part, and records the value. The secondcallback also calls back into the CPU, gets the current timestamp afterthe variable frame part and/or at the start of GPU processing tasks forthe particular frame. The timestamps may be obtained from built-intiming registers associated with the GPU. The second callback may alsocompare the values of the first timestamp and second timestamps toascertain the amount of time that has elapsed. An assessment may be madebased on the elapsed time as to whether unpredictable/system work wasinserted to the GPU workload, how much time the work or variable parttakes to complete, and/or whether or not to “fix-up” a frame by skippingsome optional portions of the frame based on the elapsed time. This mayoccur by comparing the elapsed time to a configurable timing thresholdused to control throttling. The elapsed time computed for variable partsof a particular frame will be greater if unpredictable/system work isinserted after a preceding frame and shorter under “normal” conditions.If the timing threshold is exceeded, then throttling may be triggered.It should be noted that the callbacks may occur without interrupting orsubstantially affecting the work performed by the CPU to build upcommands for subsequent frames. In other words, the callbacks may beexecuted asynchronously outside of the CPU timeline 204 for frameprocessing as is represented in FIG. 2. In a multi-processor environmentthis may be accomplished by executing the CPU timeline 204 and callbacksusing different respective processors.

Now, for each frame the elapsed time is used to drive a determination214 regarding whether to perform heavy processing 216 or lightprocessing 218 for optional portions of the frame for which processingby the GPU 124 can be throttled. For example, light processing 218 isselected for frame one in FIG. 2 because the elapsed time is relativelylarge (as represented by the relatively large hatched portion 206associated with frame one) and exceeds the configurable timingthreshold. Heavy processing 216 is selected for frame two because theelapsed time is relatively small (as represented by the small hatchedportion 206 associated with frame two) and less than the configurabletiming threshold.

To further illustrate consider the following discussion of example flowdiagrams that describe techniques for GPU self throttling that can beimplemented in accordance with one or more embodiments. The exampleprocedure(s) depicted can be implemented in connection with any suitablehardware, software, firmware, or combination thereof In at least someembodiments, the methods can be implemented by way of a suitabilityconfigured computing device, such as the example computing device 102 ofFIG. 1 that includes or otherwise makes use of a throttling module 126.

In particular, FIG. 3 depicts an example procedure 300 in which timinginformation is used to make a GPU self throttling decision. Timinginformation for GPU frame processing is obtained using a timeline forthe GPU (block 302). This can occur in any suitable way using anappropriate timing source. In one approach, the throttling module 126may use built-in registers associated with the GPU 124 to obtain thetiming information. The timing information may relate to system work orother variable frame parts/unpredictable work that is inserted into theGPU timeline and may be difficult to predict. By way of example and notlimitation, one technique to obtain the timing information involvesinserting callbacks before and after frames and/or certain variableportions of frames as previously described. The callbacks may beprovided as commands of the GPU timeline that call back into the CPU toget appropriate timing information for the GPU processing. Othersuitable techniques to obtain timing information can also be employed.

An elapsed time for system work is computed based on the obtained timinginformation (block 304) and then a determination is made based on theelapsed time regarding whether to throttle GPU work for a frame (block306). In general, the elapsed time measures how long it takes for systemwork and/or other unpredictable work that generally occurs between theend of one frame and the beginning of processing for the next frame. Asmentioned, the determination of whether to throttle work for aparticular frame may be made based on a configurable timing thresholdthat is compared to the elapsed time. If the elapsed time exceeds thethreshold, a decision may be made to throttle the work for theparticular frame. If the elapsed time is less than the threshold (e.g.,satisfies the threshold), normal work/processing for the particularframe is performed.

Thus, when a decision to throttle is made in block 306, light processingor no processing may be performed (block 308). In this case, one or morenon-critical portions of a frame may be skipped and/or alterative lightprocessing steps or command buffers may be selected for GPU processingof a corresponding frame. This may occur by disabling at least somecommands in the GPU timeline (e.g., sequence of commands) thatcorrespond to optional work of the particular frame. Commands may bedisabled/enabled on an individual basis. For example, commands may beselectively disabled by setting one or more commands and/or an entirecommand buffer of batched commands to null.

In addition or alternatively, multiple command buffers may also beestablished for the same work to enable selection between differentcorresponding levels of processing based upon the elapsed time that isdetermined in step 304. Accordingly, throttling the work may beaccomplished by selecting of a particular command buffer that isassociated with relatively light processing from among multiple commandbuffers. Here the processing may be considered light in comparison withheavy or “normal” processing that is associated with default commandsand/or a default command buffer for performing the work. In this manner,a frame may be “fixed-up” by partially or completely skipping one ormore portions of the frame designated as optional when throttling isdictated for the frame.

On the other hand, when throttling is not dictated by the decision inblock 306, heavy or “normal” processing is performed (block 310). Here,the frame may be processed using normal or default steps/command bufferswithout throttling. This may involve selecting a default command bufferfrom among multiple available command buffers. In this manner, timinginformation for system work gathered using a GPU timeline may be used todrive decisions regarding whether to throttle work performed by the GPUto render a frame.

Aspects of techniques for GPU self throttling described herein,including the example procedure 300, may be implemented by way of one ormore application programming interfaces (APIs). The APIs may be providedfor a computing device 102 by an operating system 108 or otherwise. Thethrottling module 126 may be configured to make calls to the APIs toinvoke corresponding functionality for GPU self throttling that isprovided through the APIs. Generally speaking, suitable code/commandsfor execution in the GPU timeline may be provided by the throttlingmodule 126 to make calls to the APIs at appropriate times.

For example, the one or more APIs may include a callback API that can beinvoked to insert callbacks in the GPU timeline before and after framesto initiate calls to get timestamps as described previously. Thecallbacks that are inserted through the callback API may operate bycalling a time retrieval API configured to facilitate retrieval of thetiming information from the CPU. Further, a command buffer control APImay be invoked to enable/disable various commands and/or entire commandbuffers in accordance with throttling decisions for frame processing asdescribed in the preceding discussion.

Having considered example techniques for GPU self throttling, consider adiscussion of an example system in accordance with one or moreembodiments.

Example System

FIG. 4 illustrates an example system generally at 400 that includes anexample computing device 402 that is representative of one or more suchcomputing systems and/or devices that may implement the variousembodiments described above. The computing device 402 may be, forexample, a server of a service provider, a device associated with acomputing device 102 (e.g., a client device), a system on-chip, and/orany other suitable computing device or computing system.

The example computing device 402 includes one or more processors 404 orprocessing units, one or more computer-readable media 406 which mayinclude one or more memory and/or storage components 408, one or moreinput/output (I/O) interfaces 410 for input/output (I/O) devices, and abus 412 that allows the various components and devices to communicateone to another. Computer-readable media 406 and/or one or more I/Odevices may be included as part of, or alternatively may be coupled to,the computing device 402. The bus 412 represents one or more of severaltypes of bus structures, including a memory bus or memory controller, aperipheral bus, an accelerated graphics port, and a processor or localbus using any of a variety of bus architectures. The bus 412 may includewired and/or wireless buses.

The one or more processors 404 are not limited by the materials fromwhich they are formed or the processing mechanisms employed therein. Forexample, processors may be comprised of semiconductor(s) and/ortransistors (e.g., electronic integrated circuits (ICs)). In such acontext, processor-executable instructions may beelectronically-executable instructions. The memory/storage component 408represents memory/storage capacity associated with one or morecomputer-readable media. The memory/storage component 408 may includevolatile media (such as random access memory (RAM)) and/or nonvolatilemedia (such as read only memory (ROM), Flash memory, optical disks,magnetic disks, and so forth). The memory/storage component 408 mayinclude fixed media (e.g., RAM, ROM, a fixed hard drive, etc.) as wellas removable media (e.g., a Flash memory drive, a removable hard drive,an optical disk, and so forth).

Input/output interface(s) 410 allow a user to enter commands andinformation to computing device 402, and also allow information to bepresented to the user and/or other components or devices using variousinput/output devices. Examples of input devices include a keyboard, atouchscreen display, a cursor control device (e.g., a mouse), amicrophone, a scanner, and so forth. Examples of output devices includea display device (e.g., a monitor or projector), speakers, a printer, anetwork card, and so forth.

Various techniques may be described herein in the general context ofsoftware, hardware (fixed logic circuitry), or program modules.Generally, such modules include routines, programs, objects, elements,components, data structures, and so forth that perform particular tasksor implement particular abstract data types. An implementation of thesemodules and techniques may be stored on or transmitted across some formof computer-readable media. The computer-readable media may include avariety of available medium or media that may be accessed by a computingdevice. By way of example, and not limitation, computer-readable mediamay include “computer-readable storage media” and “communication media.”

“Computer-readable storage media” may refer to media and/or devices thatenable persistent and/or non-transitory storage of information incontrast to mere signal transmission, carrier waves, or signals per se.Thus, computer-readable storage media excludes signals per se.Computer-readable storage media also includes hardware elements havinginstructions, modules, and/or fixed device logic implemented in ahardware form that may be employed in some embodiments to implementaspects of the described techniques.

The computer-readable storage media includes volatile and non-volatile,removable and non-removable media and/or storage devices implemented ina method or technology suitable for storage of information such ascomputer readable instructions, data structures, program modules, logicelements/circuits, or other data. Examples of computer-readable storagemedia may include, but are not limited to, RAM, ROM, EEPROM, flashmemory or other memory technology, CD-ROM, digital versatile disks (DVD)or other optical storage, hard disks, magnetic cassettes, magnetic tape,magnetic disk storage or other magnetic storage devices, hardwareelements (e.g., fixed logic) of an integrated circuit or chip, or otherstorage device, tangible media, or article of manufacture suitable tostore the desired information and which may be accessed by a computer.

“Communication media” may refer to a signal bearing medium that isconfigured to transmit instructions to the hardware of the computingdevice, such as via a network. Communication media typically may embodycomputer readable instructions, data structures, program modules, orother data in a modulated data signal, such as carrier waves, datasignals, or other transport mechanism. Communication media also includeany information delivery media. The term “modulated data signal” means asignal that has one or more of its characteristics set or changed insuch a manner as to encode information in the signal. By way of example,and not limitation, communication media include wired media such as awired network or direct-wired connection, and wireless media such asacoustic, RF, infrared, and other wireless media.

Combinations of any of the above are also included within the scope ofcomputer-readable media. Accordingly, software, hardware, or programmodules, including the throttling module 126, operating system 108,applications 110 and other program modules, may be implemented as one ormore instructions and/or logic embodied on some form ofcomputer-readable media.

Accordingly, particular modules, functionality, components, andtechniques described herein may be implemented in software, hardware,firmware and/or combinations thereof The computing device 402 may beconfigured to implement particular instructions and/or functionscorresponding to the software and/or hardware modules implemented oncomputer-readable media. The instructions and/or functions may beexecutable/operable by one or more articles of manufacture (for example,one or more computing devices 402 and/or processors 404) to implementtechniques for GPU self throttling, as well as other techniques. Suchtechniques include, but are not limited to, the example proceduresdescribed herein. Thus, computer-readable media may be configured tostore or otherwise provide instructions that, when executed by one ormore devices described herein, cause various techniques for GPU selfthrottling.

CONCLUSION

Although the subject matter has been described in language specific tostructural features and/or methodological acts, it is to be understoodthat the subject matter defined in the appended claims is notnecessarily limited to the specific features or acts described above.Rather, the specific features and acts described above are disclosed asexample forms of implementing the claims

What is claimed is:
 1. A computer-implemented method comprising:obtaining timing information for processing of a frame by a graphicsprocessing unit (GPU) of a computing device using a timeline for theGPU; computing an elapsed time for unpredictable work inserted into theprocessing performed by the GPU for the frame based on the obtainedtiming information; determining according to the elapsed time whether tothrottle work performed by the GPU for the frame by reducing the workfor one or more designated portions of the frame that can be throttled;and selectively performing light processing or heavy processing for theone or more designated portions of the frame based on the determination.2. The computer-implemented method of claim 1, wherein obtaining thetiming information comprises inserting callbacks into the timeline forthe GPU including a first callback before a variable part of the framein which the unpredictable work occurs and a second callback after thevariable part of the frame, the callbacks executable by the GPU toretrieve the timing information for the unpredictable work.
 3. Thecomputer-implemented method of claim 2, wherein computing the elapsedtime comprises comparing a first timestamp obtained by the firstcallback to a second timestamp obtained by the second callback.
 4. Thecomputer-implemented method of claim 1, wherein determining whether tothrottle the work performed by the GPU comprises comparing the elapsedtime to a configurable threshold established to control whether lightprocessing or heavy processing is performed for the frame.
 5. Thecomputer-implemented method of claim 1, wherein selectively performinglight processing or heavy processing comprises performing lightprocessing to throttle the work by skipping one or more commands in thetimeline for the GPU when the elapsed time exceeds a configurable timingthreshold.
 6. The computer-implemented method of claim 1, whereinselectively performing light processing or heavy processing comprisesselecting between multiple different command buffers for the work thatare associated with different amounts of processing.
 7. Thecomputer-implemented method of claim 1, further comprising making callsto one or more application programming interfaces (APIs) of thecomputing device that are operable to insert callbacks into the timelineof the GPU, return the timing information responsive to calls from theinserted callbacks, and selectively enable and disable commands toperform the light or heavy processing as directed based on thedetermination of whether to throttle the work.
 8. Thecomputer-implemented method of claim 1, wherein the timing informationis obtained using built-in timing registers associated with the GPU. 9.One or more computer-readable storage media storing instructions thatwhen executed by a computing device cause the computing device toimplement a throttling module operable to perform acts comprising:computing an elapsed time for system work inserted into a timeline for agraphics processing unit (GPU) of the computing device based ontimestamps obtained from callbacks included in the timeline for the GPUto measure the elapsed time between an end of processing for one frameand a beginning of processing for a particular frame; comparing theelapsed time to a timing threshold established to control when tothrottle work performed by the GPU to render frames; throttling the workfor the particular frame when the elapsed time exceeds the timingthreshold; and performing processing for the particular frame withoutthrottling when the elapsed time is less than the timing threshold. 10.One or more computer-readable storage media of claim 9, wherein thethrottling module is further operable to perform acts comprisinginvoking an application programming interface (API) of the computingdevice configured to cause insertion of the callbacks into the timelinefor the GPU.
 11. One or more computer-readable storage media of claim 9,wherein the callbacks are executed by a central processing unit (CPU) ofthe computing device that is separate from the GPU.
 12. One or morecomputer-readable storage media of claim 9, wherein the throttlingcomprises skipping work for one or more portions of the particular framedesignated as optional portions to reduce a workload of the GPU for theparticular frame.
 13. One or more computer-readable storage media ofclaim 9, wherein the throttling comprises setting one or more commandsfor processing of the particular frame to null to skip at least somework associated with the particular frame.
 14. One or morecomputer-readable storage media of claim 9, further comprising invokingan application programming interface (API) of the computing deviceconfigured to cause the throttling by selectively disabling at leastsome commands associated with processing for the particular frame. 15.One or more computer-readable storage media of claim 9, wherein: thethrottling module is implemented as a component of an application forthe computing device; and the application and throttling module areexecuted using different respective processes of the computing device.16. A system comprising a central processing unit (CPU); a graphicprocessing unit (GPU) separate from the CPU; and one or morecomputer-readable media storing instructions that, when executed by theGPU, implement a throttling module to perform self throttling for thegraphics processing unit (GPU) by selectively skipping optional portionsof processing for a particular frame rendered by the GPU based on anelapsed time for unpredictable work that is computed using timinginformation obtained for a timeline of the GPU.
 17. The system of claim16, wherein selectively skipping the optional portions comprises:throttling work for the particular frame when the computed elapsed timeexceeds a timing threshold by disabling at least some commands forprocessing the particular frame to skip the optional portions; andperforming processing for the particular frame without throttling whenthe computed elapsed time is less than the timing threshold.
 18. Thesystem of claim 16, wherein the throttling module is configured toinvoke one or more application programming interfaces (APIs) of thesystem to perform the self throttling for the particular frame includingcalling the one or more APIs to: insert callbacks in the timeline forthe GPU; cause execution of the callbacks to obtain the timinginformation from the CPU using timing registers associated with the GPU;enable and disable commands for processing of the optional portions ofthe particular frame based on the elapsed time.
 19. The system of claim16, wherein the system comprises a gaming system and the throttlingmodule is implemented as a component of a gaming application for thegaming system.
 20. The system of claim 16, wherein the unpredictablework is inserted into the timeline for the GPU through system processingperformed by the CPU on a timeline for the CPU.